Skip to content

feat(config): add allow_all_channels / allow_all_users flags#476

Merged
thepagent merged 2 commits intoopenabdev:mainfrom
chaodu-agent:feat/allow-all-flags
Apr 19, 2026
Merged

feat(config): add allow_all_channels / allow_all_users flags#476
thepagent merged 2 commits intoopenabdev:mainfrom
chaodu-agent:feat/allow-all-flags

Conversation

@chaodu-agent
Copy link
Copy Markdown
Collaborator

@chaodu-agent chaodu-agent commented Apr 19, 2026

Summary

Introduce explicit boolean flags allow_all_channels and allow_all_users to replace the overloaded empty-list semantics, and revert #398 (empty allowed_channels no longer denies all).

Changes

1. Revert #398

Restores allowed_channels = [] to mean allow-all (original behavior). With explicit flags, the empty-list hack is no longer needed.

2. New flags with auto-detect

Both flags default to true (allow all). When not explicitly set in config.toml, auto-detected from the list:

if allow_all_* is explicitly set → use it
else if allowed_* is non-empty   → false (respect the list)
else                              → true  (allow all)
allow_all_* allowed_* Result
true (default) ignored Allow all
false ["123"] Only listed
false [] Deny all

3. Helm always renders explicit flags

# Auto-inferred from list when user doesn't set the flag:
allow_all_channels = {{ if hasKey .discord "allowAllChannels" }}...{{ else if .discord.allowedChannels }}false{{ else }}true{{ end }}

Files Changed

  • src/config.rs: Option<bool> fields + resolve_allow_all() helper
  • src/discord.rs: Channel/user filtering uses resolved flags
  • src/slack.rs: Same
  • src/main.rs: Resolves flags, logs them, warns on deny-all scenarios
  • charts/openab/templates/configmap.yaml: Always renders explicit flags
  • charts/openab/values.yaml: Documents new flags
  • config.toml.example: Documents new flags

Backward Compatibility

Zero config changes required for any existing deployment:

Closes #475

@chaodu-agent chaodu-agent requested a review from thepagent as a code owner April 19, 2026 16:31
@github-actions github-actions bot added the closing-soon PR missing Discord Discussion URL — will auto-close in 3 days label Apr 19, 2026
@github-actions
Copy link
Copy Markdown

⚠️ This PR is missing a Discord Discussion URL in the body.

All PRs must reference a prior Discord discussion to ensure community alignment before implementation.

Please edit the PR description to include a link like:

Discord Discussion URL: https://discord.com/channels/...

This PR will be automatically closed in 3 days if the link is not added.

Reverts the empty-list-means-deny-all behavior from openabdev#398.
With explicit allow_all_* flags (next commit), the empty-list hack
is no longer needed — the flags become the single source of truth.
@chaodu-agent chaodu-agent force-pushed the feat/allow-all-flags branch from 9fa361f to 2658ea4 Compare April 19, 2026 16:38
Introduce explicit boolean flags to replace overloaded empty-list semantics
for allowed_channels and allowed_users.

Both flags default to true (allow all). When not explicitly set in config,
auto-detected from the list: non-empty list → false, empty list → true.
This ensures zero config changes for any existing deployment.

Truth table:
  allow_all_* = true  → allow all (list ignored)
  allow_all_* = false + list non-empty → only listed
  allow_all_* = false + list empty → deny all

Helm chart always renders explicit flags (auto-inferred from list if user
does not set the flag), so the Rust runtime sees fully resolved values.

Closes openabdev#475
@chaodu-agent chaodu-agent force-pushed the feat/allow-all-flags branch from 2658ea4 to c577e73 Compare April 19, 2026 16:42
@chaodu-agent
Copy link
Copy Markdown
Collaborator Author

LGTM ✅

Clean implementation of explicit allow_all_channels / allow_all_users flags with auto-detect from list. Revert of #398 is correct — the flags are now the single source of truth.

Backward compatibility verified for all deployment scenarios (pre-#398, post-#398, new). Helm nil guards handle edge cases properly.

@thepagent thepagent merged commit 11dfcb5 into openabdev:main Apr 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closing-soon PR missing Discord Discussion URL — will auto-close in 3 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(config): add explicit allow_all_channels / allow_all_users flags

2 participants